package com.sfh.alliance.home;

import android.content.Context;
import android.support.annotation.IdRes;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sfh.alliance.AnimaUtil;
import com.sfh.alliance.R;

/**
 * 功能描述:
 *
 * @author SunFeihu 孙飞虎
 * @company 中储南京智慧物流科技有限公司
 * @copyright （版权）中储南京智慧物流科技有限公司所有
 * @date 2017/9/5
 */
public class TopView extends RelativeLayout {

    TextView tv_top;

    ImageView iv_out;

    ImageView iv_photo;

    TextView tv_sl;

    TextView tv_bl;

    TextView tv_money;

    TextView tv_res;

    public TopView(Context context) {

        super (context);  init();
    }

    public TopView(Context context, AttributeSet attrs) {

        super (context, attrs);  init();
    }

    public TopView(Context context, AttributeSet attrs, int defStyleAttr) {

        super (context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        //
        this.inflate (getContext (), R.layout.main_top_layout, this);

        tv_top = $ (R.id.tv_top);
        iv_out = $ (R.id.iv_out);
        iv_photo = $ (R.id.iv_photo);
        tv_sl = $ (R.id.tv_sl);
        tv_bl = $ (R.id.tv_bl);
        tv_money = $ (R.id.tv_money);
        tv_res = $ (R.id.tv_res);

        iv_out.setAnimation (AnimaUtil.getScaleAnimation ());
    }

    private <T extends View> T $(@IdRes int resId) {

        return (T) super.findViewById (resId);
    }

}
